<nz-spin [nzSpinning]="isSpinning">
  <form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm($event,validateForm.value)">
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label nz-form-item-required>单位类型</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('partyType')">
        <nz-select nzAllowClear [nzPlaceHolder]="'请选择'" [nzShowSearch]="true" formControlName="partyType" [nzSize]="'large'"
          [(ngModel)]="companyBean.partyType" name="partyType">
          <nz-option *ngFor="let item of partyTypeList" [nzLabel]="item.label" [nzValue]="item.value"></nz-option>
        </nz-select>
        <div nz-form-explain *ngIf="getFormControl2('partyType').dirty&&getFormControl2('partyType').hasError('required')">单位类型不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label nz-form-item-required>单位名称</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('partyName')">
        <nz-input formControlName="partyName" [nzType]="'text'" [nzPlaceHolder]="'请输入单位名称'" [nzSize]="'large'"
          [(ngModel)]="companyBean.partyName">
        </nz-input>
        <div nz-form-explain *ngIf="getFormControl2('partyName').dirty&&getFormControl2('partyName').hasError('required')">单位名称不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label for="addresOptions">行政区划</label>
      </div>
      <div nz-form-control nz-col [nzSpan]="8" nzHasFeedback [nzValidateStatus]="getFormControl2('addresOptions')">
        <nz-cascader formControlName="addresOptions" [nzExpandTrigger]="'hover'" [nzOptions]="options" [(ngModel)]="addresOptions"
          (nzLoad)="loadData($event)" nzPlaceHolder="请选择行政区划">
        </nz-cascader>
        <div nz-form-explain *ngIf="getFormControl2('addresOptions').dirty&&getFormControl2('addresOptions').hasError('required')">行政区划不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label>单位地址</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('partyAddr')">
        <nz-input formControlName="partyAddr" [nzType]="'text'" [nzPlaceHolder]="'请输入单位地址'" [nzSize]="'large'"
          [(ngModel)]="companyBean.partyAddr">
        </nz-input>
        <div nz-form-explain *ngIf="getFormControl2('partyAddr').dirty&&getFormControl2('partyAddr').hasError('required')">单位地址不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label>法人代表</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('corporation')">
        <nz-input formControlName="corporation" [nzType]="'text'" [nzPlaceHolder]="'请输入法人代表'" [nzSize]="'large'"
          [(ngModel)]="companyBean.corporation">
        </nz-input>
        <div nz-form-explain *ngIf="getFormControl2('corporation').dirty&&getFormControl2('corporation').hasError('required')">法人代表不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label>单位电话</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('telephone')">
        <nz-input formControlName="telephone" [nzType]="'text'" [nzPlaceHolder]="'请输入单位电话'" [nzSize]="'large'"
          [(ngModel)]="companyBean.telephone">
        </nz-input>
        <div nz-form-explain *ngIf="getFormControl2('telephone').dirty&&getFormControl2('telephone').hasError('required')">单位电话不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label>邮政编码</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('postalCode')">
        <nz-input formControlName="postalCode" [nzType]="'text'" [nzPlaceHolder]="'请输入邮政编码'" [nzSize]="'large'"
          [(ngModel)]="companyBean.postalCode">
        </nz-input>
        <div nz-form-explain *ngIf="getFormControl2('postalCode').dirty&&getFormControl2('postalCode').hasError('required')">邮政编码不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label>组织机构代码/全国统一信用代码</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('creditCode')">
        <nz-input formControlName="creditCode" [nzType]="'text'" [nzPlaceHolder]="'请输入组织机构代码/全国统一信用代码'" [nzSize]="'large'"
          [(ngModel)]="companyBean.creditCode">
        </nz-input>
        <div nz-form-explain *ngIf="getFormControl2('creditCode').dirty&&getFormControl2('creditCode').hasError('required')">组织机构代码/全国统一信用代码不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label>营业执照注册号</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('businessLicenseNum')">
        <nz-input formControlName="businessLicenseNum" [nzType]="'text'" [nzPlaceHolder]="'请输入营业执照注册号'" [nzSize]="'large'"
          [(ngModel)]="companyBean.businessLicenseNum">
        </nz-input>
        <div nz-form-explain *ngIf="getFormControl2('businessLicenseNum').dirty&&getFormControl2('businessLicenseNum').hasError('required')">营业执照注册号不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label>所属行业</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('industry')">
        <nz-input formControlName="industry" [nzType]="'text'" [nzPlaceHolder]="'请输入所属行业'" [nzSize]="'large'"
          [(ngModel)]="companyBean.industry">
        </nz-input>
        <div nz-form-explain *ngIf="getFormControl2('industry').dirty&&getFormControl2('industry').hasError('required')">所属行业不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label for="">组织机构代码证或营业执照</label>
      </div>
      <div nz-form-control nz-col [nzSm]="8" [nzXs]="24" nzHasFeedback>
        <nz-upload nzAction="{{config.IP+config.API.upload}}" nzListType="picture-card" [(nzFileList)]="fileList"
          [nzPreview]="handlePreview" [nzRemove]="nzRemoveFile" (nzChange)="handleChange($event)">
          <i class="anticon anticon-plus"></i>
          <div class="ant-upload-text">上传</div>
        </nz-upload>
        <nz-modal [nzVisible]="previewVisible" [nzContent]="modalContent" [nzFooter]="null" (nzOnCancel)="previewVisible=false">
          <ng-template #modalContent>
            <img [src]="previewImage" [ngStyle]="{ 'width': '100%' }" />
          </ng-template>
        </nz-modal>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label for="">单位资质证书</label>
      </div>
      <div nz-form-control nz-col [nzSm]="8" [nzXs]="24" nzHasFeedback>
        <nz-upload nzAction="{{config.IP+config.API.upload}}" nzListType="picture-card" [(nzFileList)]="zzzsList"
          [nzPreview]="handlePreview2" [nzRemove]="nzRemoveFile2" (nzChange)="handleChange2($event)">
          <i class="anticon anticon-plus"></i>
          <div class="ant-upload-text">上传</div>
        </nz-upload>
        <nz-modal [nzVisible]="previewVisible" [nzContent]="modalContent" [nzFooter]="null" (nzOnCancel)="previewVisible=false">
          <ng-template #modalContent>
            <img [src]="previewImage" [ngStyle]="{ 'width': '100%' }" />
          </ng-template>
        </nz-modal>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label>单位资质等级</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('zzdj')">
        <nz-input formControlName="zzdj" [nzType]="'text'" [nzPlaceHolder]="'请输入资质等级'" [nzSize]="'large'" [(ngModel)]="companyBean.zzdj">
        </nz-input>
        <!-- <div nz-form-explain *ngIf="getFormControl2('zzdj').dirty&&getFormControl2('zzdj').hasError('required')">不能为空!</div> -->
      </div>
    </div>
    <div nz-form-item nz-row *ngIf="companyBean.partyType=='1'">
      <div nz-form-label nz-col [nzSpan]="9">
        <label>维保星级</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('maintStart')">
        <nz-select nzAllowClear [nzPlaceHolder]="'请选择'" [nzShowSearch]="true" formControlName="maintStart" [nzSize]="'large'"
          [(ngModel)]="companyBean.maintStart" name="maintStart">
          <nz-option *ngFor="let item of startList" [nzLabel]="item.label" [nzValue]="item.value"></nz-option>
        </nz-select>
        <!-- <div nz-form-explain *ngIf="getFormControl2('zzdj').dirty&&getFormControl2('zzdj').hasError('required')">不能为空!</div> -->
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label>联系人</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('contacts')">
        <nz-input formControlName="contacts" [nzType]="'text'" [nzPlaceHolder]="'请输入联系人'" [nzSize]="'large'"
          [(ngModel)]="companyBean.contacts">
        </nz-input>
        <div nz-form-explain *ngIf="getFormControl2('contacts').dirty&&getFormControl2('contacts').hasError('required')">联系人不能为空!</div>
        <div style="color: red">联系人为单位账号持有者，更换单位账号持有者时，请及时修改联系人信息！</div>
      </div>

    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label for="contactsWork">联系人职务</label>
      </div>
      <div nz-form-control nz-col [nzSpan]="8" nzHasFeedback [nzValidateStatus]="getFormControl2('contactsWork')">
        <nz-input [nzSize]="'large'" formControlName="contactsWork" [nzPlaceHolder]="'请输入联系人职务'" [nzType]="'contactsWork'"
          [nzId]="'contactsWork'" [(ngModel)]="companyBean.contactsWork"></nz-input>
        <div nz-form-explain *ngIf="getFormControl2('contactsWork').dirty&&getFormControl2('contactsWork').hasError('required')">联系人职务不能为空!</div>
      </div>
    </div>

    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label for="contactsCard">联系人身份证号</label>
      </div>
      <div nz-form-control nz-col [nzSpan]="8" nzHasFeedback [nzValidateStatus]="getFormControl2('contactsCard')">
        <nz-input [nzSize]="'large'" formControlName="contactsCard" [nzPlaceHolder]="'请输入联系人身份证号'" [nzType]="'contactsCard'"
          [nzId]="'contactsCard'" [(ngModel)]="companyBean.contactsCard"></nz-input>
        <div nz-form-explain *ngIf="getFormControl2('contactsCard').dirty&&getFormControl2('contactsCard').hasError('required')">联系人身份证号码为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label for="contactsPhone">联系人电话</label>
      </div>
      <div nz-form-control nz-col [nzSpan]="8" nzHasFeedback [nzValidateStatus]="getFormControl2('contactsPhone')">
        <nz-input [nzSize]="'large'" formControlName="contactsPhone" [nzPlaceHolder]="'请输入联系人电话'" [nzType]="'contactsPhone'"
          [nzId]="'contactsPhone'" [(ngModel)]="companyBean.contactsPhone"></nz-input>
        <div nz-form-explain *ngIf="getFormControl2('contactsPhone').dirty&&getFormControl2('contactsPhone').hasError('required')">联系人电话不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label for="contactsEmile">联系人邮箱</label>
      </div>
      <div nz-form-control nz-col [nzSpan]="8" nzHasFeedback [nzValidateStatus]="getFormControl2('contactsEmile')">
        <nz-input [nzSize]="'large'" formControlName="contactsEmile" [nzPlaceHolder]="'请输入联系人邮箱'" [nzType]="'contactsEmile'"
          [nzId]="'contactsEmile'" [(ngModel)]="companyBean.contactsEmile"></nz-input>
        <div nz-form-explain *ngIf="getFormControl2('contactsEmile').dirty&&getFormControl2('contactsEmile').hasError('required')">联系人邮箱不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label for="contactsMobile">联系人手机</label>
      </div>
      <div nz-form-control nz-col [nzSpan]="8" nzHasFeedback [nzValidateStatus]="getFormControl2('contactsMobile')">
        <nz-input [nzSize]="'large'" formControlName="contactsMobile" [nzPlaceHolder]="'请输入联系人手机'" [nzType]="'contactsMobile'"
          [nzId]="'contactsMobile'" [(ngModel)]="companyBean.contactsMobile"></nz-input>
        <div nz-form-explain *ngIf="getFormControl2('contactsMobile').dirty&&getFormControl2('contactsMobile').hasError('required')">联系人手机不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row>
      <div nz-form-label nz-col [nzSpan]="9">
        <label>联系人地址</label>
      </div>
      <div nz-col [nzSpan]="8" nz-form-control nzHasFeedback [nzValidateStatus]="getFormControl2('contactsAddress')">
        <nz-input formControlName="contactsAddress" [nzType]="'text'" [nzPlaceHolder]="'请输入联系人地址'" [nzSize]="'large'"
          [(ngModel)]="companyBean.contactsAddress">
        </nz-input>
        <div nz-form-explain *ngIf="getFormControl2('contactsAddress').dirty&&getFormControl2('contactsAddress').hasError('required')">联系人地址不能为空!</div>
      </div>
    </div>
    <div nz-form-item nz-row style="margin-bottom:8px;">
      <div nz-form-control nz-col [nzSpan]="14" [nzOffset]="10">
        <button nz-button [nzSize]="'large'" [nzType]="'primary'">添加</button>
      </div>
    </div>
  </form>
</nz-spin>
